#导入线程库
import threading
import time


#打印数据函数
def print_number():
    for i in range(10):
        print(i)
        time.sleep(2)

#打印字母函数
def print_letter():
    for letter in ["a","b","c","d","e","f","g"]:
        print(letter)
        time.sleep(2)


#程序入口
if __name__=="__main__":
    #创建线程
    thread1 = threading.Thread(target=print_letter)
    thread2 = threading.Thread(target=print_number)

    #启动线程
    thread1.start()
    thread2.start()

    #join 阻塞主进程  子进程/线程执行完再执行主进程
    thread1.join()
    thread2.join()

    print("主进程执行完了！")